package com.example.beauty.db.gen;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Unique;
import org.greenrobot.greendao.annotation.Generated;

import java.io.Serializable;

/**
 * 创建bean对象实体，只有被Entity修饰的bean实体才能被GreenDao操作。
 */

@Entity
public class Note implements Serializable {
    /*实现Serializable接口为的是在ContactMain中利用Intent向
    * EditContact传递一个Note对象*/
    //应数据表中的 Id 字段，是一条数据的唯一标识，相当于主键
    @Id(autoincrement = true)
    private Long id;

    //给名为name的属性非空的约束
    @NotNull
    private String name;

    //创造或者修改日期
    @Property(nameInDb = "date")
    private String date;

    //给名为phone的属性唯一的约束
    @Unique
    private String phone;

    public Note(){ }

    public Note(Long id) {  this.id = id;}


    @Generated(hash = 714427320)
    public Note(Long id, @NotNull String name, String date, String phone) {
        this.id = id;
        this.name = name;
        this.date = date;
        this.phone = phone;
    }
    

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /** Not-null value. */
    public String getName() {return name;}

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

//    public void setId(long id) {
//        this.id = id;
//    }
}
